﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using PMPUtils.Form;
using PMPUtils.Resources;

namespace PMP.Report
{
    public partial class Dashboard : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            FormUtil.Authenticate(Session, Response);

            if (!IsPostBack)
            {
                txtSprint.Text = Request.Params["SPRINT"];
            }
        }

        protected void btnTMDashboard_Click(object sender, EventArgs e)
        {
            PopupForm tmDashboard = new PopupForm(Response, "TMDashboard.aspx", "TMDashboard", "1000", "500", "50", "100");
            tmDashboard.Popup();

            Close();
        }

        protected void btnDependentLevel_Click(object sender, EventArgs e)
        {
            PopupForm dependentLevelDashboard = new PopupForm(Response, "DependentLevelsReport.aspx", "DependentLevelsReport", "1000", "800", "50", "100");
            dependentLevelDashboard.Popup();

            Close();
        }

        private void Close()
        {
            PopupForm thisForm = new PopupForm(Response);
            thisForm.Close();
        }

        protected void btnSLA_Click(object sender, EventArgs e)
        {
            PopupForm SLA = new PopupForm(Response, "SLA.aspx", "SLA", "1000", "500", "50", "100");
            SLA.Popup();

            Close();
        }

        protected void btnResourceUtilization_Click(object sender, EventArgs e)
        {
            PopupForm ResourceUtilizations = new PopupForm(Response, "http://bs-pc-664:9090/Reports/ResourceUtilizations.aspx", "ResourceUtilization", "1000", "500", "50", "100");
            ResourceUtilizations.Popup();

            Close();
        }

        protected void btnTimeLogging_Click(object sender, EventArgs e)
        {
            PopupForm TimeloggingReport = new PopupForm(Response, "TimeloggingReport.aspx", "Timelogging", "1000", "500", "50", "100");
            TimeloggingReport.Popup();

            Close();
        }

        protected void btnResourceLevel_Click(object sender, EventArgs e)
        {
            PopupForm ResourceLevelsReport = new PopupForm(Response, "http://bs-pc-664:9090/Reports/ResourceLevelsReport.aspx", "ResourceLevelsReport", "1000", "500", "50", "100");
            ResourceLevelsReport.Popup();

            Close();
        }

        protected void btnWeeklyUpdate_Click(object sender, EventArgs e)
        {
            PopupForm weeklyUpdate = new PopupForm(Response, "WeeklyUpdate.aspx?SPRINT=" + txtSprint.Text.Trim(), "WeeklyUpdate", "800", "500", "50", "100");
            weeklyUpdate.Popup();

            Close();
        }

        protected void btnDailyUpdate_Click(object sender, EventArgs e)
        {
            PopupForm dailyUpdate = new PopupForm(Response, "DailyUpdate.aspx?SPRINT=" + txtSprint.Text.Trim(), "WeeklyUpdate", "900", "800", "50", "100");
            dailyUpdate.Popup();

            Close();
        }

        protected void btnBurndown_Click(object sender, EventArgs e)
        {
            PopupForm burndown = new PopupForm(Response, "Burndown.aspx?SPRINT=" + txtSprint.Text.Trim(), "Burndown", "1100", "300", "50", "100");
            burndown.Popup();

            Close();
        }

        protected void btnBurndownByStoryCount_Click(object sender, EventArgs e)
        {
            PopupForm burndown = new PopupForm(Response, "BurndownByStoryCount.aspx", "BurndownByStoryCount", "1000", "600", "50", "100");
            burndown.Popup();

            Close();
        }

        protected void btnScoreboard_Click(object sender, EventArgs e)
        {
            PopupForm popup = new PopupForm(Response, "ScoreboardReport.aspx", "ScoreboardReport", "1000", "800", "50", "100");
            popup.Popup();

            Close();
        }
    }
}
